<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<title>emplist</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" th:href="@{/css/style.css}" />
	</head>
	<body>
		<div id="wrap">
			<div id="top_content"> 
				<div id="header">
					<div id="rightheader">

					</div>
					<div id="topheader">
						<h1 id="title">
							<a href="#">main</a>
						</h1>
					</div>
					<div id="navigation">
					</div>
				</div>
				<div id="content">
					<p id="whereami">
					</p>

					<table class="table">
						<tr class="table_header">
							<td>
								安卓系统ID
							</td>
							<td>
								设备产商
							</td>
							<td>
								系统型号
							</td>
							<td>
								场所名称
							</td>
							<td>
								是否授权 1-是，0-否
							</td>
							<td>
								ip地址
							</td>
							<td>
								修改时间
							</td>
							<td>操作
							</td>

						</tr>
						<tr th:each="shebei:${shebeiList}" class="row1">

							<td>
								<span th:text="${shebei.getAndroidId()}"></span>
							</td>

							<td>
								<span th:text="${shebei.getDeviceBrand()}"></span>
							</td>
							<td>
								<span th:text="${shebei.getSystemModel()}"></span>
							</td>
							<td>
								<span th:text="${shebei.getSiteName()}"></span>
							</td>
							<td>
								<span th:text="${shebei.getAuthStatus()}"></span>
							</td>
							<td>
								<span th:text="${shebei.getIp()}"></span>
							</td>
							<td>

								<!--<span th:text="${shebei.getUpdatetime()}"></span>-->
								<span th:text="${#dates.format(shebei.getUpdateTime(), 'yyyy-MM-dd HH:mm:ss')}"></span>
							</td>
							<td>

								<a href="javascript:;"  th:onclick="'deleteshebei('+${shebei.androidId}+')'">删除</a>

								<!--						多个参数传入的写法		<a th:href="@{/employee/detail(id=${employee.id},name=${employee.name})}"></a>-->
								<a th:href="@{/shebei/findById(androidId=${shebei.androidId})}">更新</a>
							</td>
							</td>
						</tr>
						<script>
							function deleteshebei(androidId){
								console.log(androidId);
								if (window.confirm("确定要删除这条记录吗?")){
									location.href='[[@{/shebei/delete?androidId=}]]'+androidId;
								}
							}

						</script>
						<p>
							<input type="button" class="button" value="添加" onclick="addEmp()"/>
							<!--多个参数传入的写法		<a th:href="@{/employee/detail(id=${employee.id},name=${employee.name})}"></a>-->
							<input type="text" id="deviceBrandText" th:value="${shebei.deviceBrand}" placeholder="搜索:安卓Id查询"/>
							<input type="text" id="ipText" th:value="${shebei.ip}" placeholder="搜索:ip查询"/>
							<input type="button" class="button" value="搜索" onclick="getData()"/>
							<script type="">
							function addEmp(){
								location.href='[[@{/addEmp}]]';
							}
							var page = [[${shebei.page}]];
							var rows = 3;
							function getData(index){
								if(index){
									page += index;
								}
								//根据id，获取搜索框value值
								var deviceBrand = document.getElementById("deviceBrandText").value;
								var ip = document.getElementById("ipText").value;
								location.href='[[@{/shebei/lists?deviceBrand=}]]'+deviceBrand+'&ip='+ip+'&page='+page+'&rows='+rows;
							}
						</script>

						</p>

					</table>
				</div>
			</div>
			<div id="footer">

				<div id="footer_bg">
					ABC@126.com
					<input type="button" class="button" value="上一页" onclick="getData(-1)"/>
					当前页<span id="page" th:text="${shebei.page}"></span>
					<input type="button" class="button" value="下一页" onclick="getData(1)"/>
				</div>
			</div>
		</div>
	</body>
</html>
